package com.itjiange.service;

import com.itjiange.common.FileListener;

import java.io.File;

import static com.itjiange.constant.LoggerConstant.logger;

/**
 * 文件监听
 *
 * @author ItJiange
 * @date 2023/10/20
 */
public class FileListenerService extends FileListener {
    private static final FileUploadService fileUploadService = new FileUploadService();
    @Override
    public void onFileCreate(File file) {
//        fileUploadService.sendFileMessage(file, FileStatus.CREATE.getDesc());
        logger.info("创建文件 : " + file.getAbsolutePath());
    }

    @Override
    public void onFileChange(File file) {
//        fileUploadService.sendFileMessage(file, FileStatus.CHANGE.getDesc());
        logger.info("修改文件 : " + file.getAbsolutePath());
    }

    @Override
    public void onFileDelete(File file) {
//        fileUploadService.sendFileMessage(file, FileStatus.DELETE.getDesc());
        logger.info("删除文件 : " + file.getAbsolutePath());
    }
}
